home *** CD-ROM | disk | FTP | other *** search
/ Aminet 33 / Aminet 33 - October 1999.iso / Aminet / util / time / backclock.lha / backclock / Install < prev   
Encoding:
Text File  |  1999-08-16  |  5.2 KB  |  210 lines

  1. ;/* install script version 1.4
  2. ; * $VER: BCInstall 1.4 (16-06-99)
  3. ; */
  4.  
  5. ; set some constant
  6.  
  7. (set #inst_text "BackClock Installation on Hard Disk")
  8. (set #prog "backclock")
  9. (set #rtlib  "rtracker.library")
  10. (set #ledlib "led.image")
  11. (set @appname "BackClock")
  12. (set #gosrc      1)
  13. (set #gobootup   1)
  14. (set #defpathprefs "sys:prefs/")
  15. (set #libs_src "libs")
  16. (set #libs_dst "libs:")
  17. (set #clas_dst "SYS:Classes/images")
  18. (set #prefsprompt "Do you want to install default preferences\nThis will erase your last settings !")
  19. (set #prefshelp "This will overwrite the file\nbackclock.prefs in env: & envarc:")
  20. (set #destdir_prompt "Where do you want to install BackClock\nA drawer will be created.")
  21. (set #destdirprefs   "Where do you want to install BackClock preferences.")
  22.  
  23. ; asks where to put the prog
  24. (set #destdir (askdir
  25.     (prompt #destdir_prompt)
  26.     (help @askdir-help)
  27.     (default "Work:")
  28.   )
  29. )
  30.  
  31.  
  32. (set @default-dest (tackon #destdir "BackClock"))
  33. (if (not (exists (@default-dest)))
  34.   (makedir @default-dest (infos))
  35. )
  36.  
  37.  
  38. ; update rtracker.library if needed
  39. (copylib
  40.   (prompt  "Updating rtracker.library")
  41.   (source  (tackon #libs_src #rtlib))
  42.   (dest    #libs_dst)
  43.   (help    @copylib-help)
  44.   (confirm expert)
  45. )
  46. ; update or copy led.image
  47. (copylib
  48.   (prompt "Update or copy led.image")
  49.   (source (tackon #libs_src #ledlib))
  50.   (dest   #clas_dst)
  51.   (help    @copylib-help)
  52.   (confirm expert)
  53. )
  54.  
  55. ; asks if the user wants to start backclock at startup
  56. (if (>= @user-level 1)
  57.   (set #gobootup
  58.     (askbool
  59.       (prompt "Do you want to run BackClock each startup ?")
  60.       (help   "If you answer yes, then BackClock will be copied to SYS:WBStartup.")
  61.     )
  62.   )
  63. )
  64.  
  65. (set #sourcepath @default-dest)
  66.  
  67. ; asks the path for the prefs prog (BCPrefs & style)
  68. (if (>= @user-level 1)
  69.   (set #defpathprefs (askdir
  70.     (prompt #destdirprefs)
  71.     (help   "Please choose where to place the preferences utility.")
  72.     (default #defpathprefs)
  73.     )
  74.   )
  75. )
  76. (if (>= @user-level 1)
  77.   (if (askbool
  78.         (prompt "Do you want to install sources ?")
  79.         (help   "This will install the sources of the program in the directory sources./")
  80.       )
  81.       (
  82.         ;install sources
  83.         (set #gosrc 1)
  84.         (if (= 2 @user-level)
  85.           (
  86.             (set #sourcepath (askdir
  87.                 (prompt "Where do you want to install sources codes ?\nA drawer called sources will be created there.")
  88.                 (help   "You have to choose where the sources be placed.")
  89.                 (default @default-dest)
  90.               )
  91.             )
  92.           )
  93.         )
  94.       )
  95.       ; don't install sources
  96.       (set #gosrc 0)
  97.   )
  98. )
  99. ; asks the user if he wants to use default prefs
  100. (run "c/defconf"
  101.   (prompt #prefsprompt)
  102.   (help   #prefshelp)
  103.   (confirm)
  104. )
  105.  
  106. ; here the script asks for the guide to install
  107. ; english or german
  108. (set #catalog
  109.   (askchoice
  110.     (prompt "Select your desired guide file")
  111.     (help   "If you know english then choose english\nIf you know german then choose german")
  112.     (choices "English" "German" "Français")
  113.     (default 0)
  114.   )
  115. )
  116. ; copies the sources
  117. (if (= 1 #gosrc)
  118.   ((if (not (exists (tackon #sourcepath "sources")))
  119.                (makedir (tackon #sourcepath "sources"))
  120.             )
  121.   )
  122. )
  123.  
  124. ; not preset directory ?
  125. (if (not (exists "sys:prefs/presets"))
  126.   (makedir "sys:prefs/presets")
  127. )
  128.  
  129. ; copy the presets
  130. (copyfiles
  131.   (prompt "Copying presets")
  132.   (help   "This whill copy presets to sys:prefs/presets\nYou can change presets by using it in the preferences")
  133.   (source "presets")
  134.   (dest   "sys:prefs/presets")
  135.   (all)
  136. )
  137.  
  138. ; copy the main files
  139. (copyfiles
  140.   (prompt "Copying Main file")
  141.   (help   "Copy the executable and the icon of the main file in the path you choosed")
  142.   (source "bin/")
  143.   (dest   @default-dest)
  144.   (all)
  145. )
  146. (copyfiles
  147.   (prompt "Copying preferences program")
  148.   (help   "Copy the preferences executable and the icon file in the path you choosed")
  149.   (source "prefs/")
  150.   (dest   #defpathprefs)
  151.   (all)
  152. )
  153. ; copies the guide
  154. (if (= #catalog 0)
  155.   (copyfiles
  156.     (prompt "Copying documentation")
  157.     (help   "Copy the documentation in the path you choosed")
  158.     (source "docs/backclockE.guide")
  159.     (newname "backclock.guide")
  160.     (dest   @default-dest)
  161.   )
  162. )
  163. (if (= #catalog 1)
  164.   (copyfiles
  165.     (prompt "Copying documentation")
  166.     (help   "Copy the documentation in the path you choosed")
  167.     (source "docs/backclockD.guide")
  168.     (newname "backclock.guide")
  169.     (dest   @default-dest)
  170.   )
  171. )
  172. (if (= #catalog 2)
  173.   (copyfiles
  174.     (prompt "Copying documentation")
  175.     (help   "Copy the documentation in the path you choosed")
  176.     (source "docs/backclockF.guide")
  177.     (newname "backclock.guide")
  178.     (dest   @default-dest)
  179.   )
  180. )
  181. ; copies the guide icon
  182. (copyfiles
  183.   (prompt "Copying icon documentation")
  184.   (help   "This copies the icon file for the documentation at the desired place")
  185.   (source "docs/BackClock.Guide.info")
  186.   (dest   @default-dest)
  187. )
  188.  
  189. ; place backclock in the wbstartup
  190. (if (= 1 #gobootup)
  191.   (copyfiles
  192.     (prompt "Copying to WBStartup")
  193.     (help   "Copy the executable file to wbstartup\nThis will run BackClock each reboot.")
  194.     (source "bin/backclock")
  195.     (dest   "SYS:WBstartup/")
  196.     (infos)
  197.   )
  198. )
  199.  
  200. (if (= 1 #gosrc)
  201.   (copyfiles
  202.     (prompt "Copying sources")
  203.     (help   "Copy the sources in C in the the path you choosed")
  204.     (source "sources/")
  205.     (dest   (tackon #sourcepath "sources"))
  206.     (all)
  207.   )
  208. )
  209.  
  210.